chrome.tabs.onUpdated.addListener((tabId,tab)=>{
    if(tab.url && tab.url.includes("bilibili.com/video")){
        const queryParmeters = tab.url.split("?")[1];
        const urlParameters = new URLSearchParams(queryParmeters)
        const BV = tab.url.match(/\/BV(.*)\//)[1]
        chrome.tabs.sendMessage(tabId, {
            type: "NEW",
            videoId: BV
        })
    }
})